An anti-theft device is usually applied to protect an electronic device from theft. A traditional anti-theft device includes a lock, which is used to fasten the electronic device to a desk or some other platform. A locking piece engages with the electronic device to fasten the electronic device, and then a screw is used to lock the electronic device. The screw is easy to disassemble from the electronic device, which could lead to theft of the electronic device.